<template>
  <div class="chart-title">
    <div class="left">
      <svg-icon :name="icon" size="14"></svg-icon>
      <span>
        <slot></slot>
      </span>
    </div>
    <div v-if="unit" class="right">单位：{{unit}}</div>
  </div>
</template>

<script>
export default {
  props: {
    icon: String,
    unit: String
  }
}
</script>

<style lang="less" scoped>
.chart-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  .left {
    display: flex;
    align-items: center;
    span {
      font-size: 12px;
      margin-left: 8px;
      line-height: 1.5;
    }
  }
  .right {
    font-size: 12px;
    color: rgba(255, 255, 255, .6);
    line-height: 1.5;
  }
}
</style>
